package com.leo.springbootmultithreadbasic.synchronizedkey.synchronizedcodeblock.synchronizedclass;

/**
 *
 * @author Leo
 * @version V1.0
 */
public class MainDemo {
    public static void main(String[] args) {
        test();
    }

    /**
     * 测试场景：
     * Synchronized同步代码块，synchronized (Class)
     *
     */
    public static void test() {
        MyService myService = new MyService();
        Thread threadA = new MyThread(myService);
        threadA.setName("A");
        threadA.start();

        Thread threadB = new MyThread2(myService);
        threadB.setName("B");
        threadB.start();

    }
}
